home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ For TASM / THUNK95.PAK / THUNKOBJ.THK < prev    next >
Text File  |  1996-02-21  |  2KB  |  82 lines

  1. //========================================================================
  2. // Thunk95 example program
  3. // Copyright (c) 1996 by Borland International, All Rights Reserved
  4. //========================================================================
  5.  
  6. enablemapdirect3216=true;  // calls from 32- to 16-bit module.
  7.  
  8. // Since the thunk compiler does not appear to support any type of
  9. // preprocessor directives, we cannot make conditional use of tools.h,
  10. // where these structures are actually defined. So, we must make sure
  11. // that the script definitions stay in sync with those in the C/C++
  12. // header files.
  13.  
  14. //
  15. // The thunk compiler supports only integral types and structures. It
  16. // does not support enum's or floating point numbers. So, we will use
  17. // an unsigned short in place of enums and appropriately sized
  18. // structures for reals. Pointers can also be used for reals.
  19. //
  20. typedef unsigned char UCHAR;
  21. typedef unsigned short USHORT;
  22. typedef unsigned int UINT;
  23. typedef unsigned long ULONG;
  24.  
  25. typedef UCHAR ENUM;
  26. typedef struct tagFloat { ULONG l; } TFloat;                   // 32 bits
  27. typedef struct tagDouble { ULONG v1; ULONG v2; } TDouble;      // 64 bits
  28. typedef struct tagLDouble { TDouble v1; USHORT v2; } TLDouble; // 80 bits
  29.  
  30. typedef struct tagEmpRecord
  31.    {
  32.    USHORT         empNum;
  33.    char           name [20];
  34.    char           family [20];
  35.    UINT           status;
  36.    int            dept;
  37.    TFloat         wage;
  38.    TDouble        ytdEarnings;
  39.    ULONG          ssn;
  40.    } EmpRecord;
  41.  
  42. typedef EmpRecord* LpEmpRecord;
  43.  
  44. //
  45. // Note that function prototypes do not use any type of storage
  46. // specifier. The thunk compiler assumes that the functions will use
  47. // Pascal calling convention on the 16-bit side and Standard Call
  48. // calling convention on the 32-bit side. These are defaults in the
  49. // Microsoft compiler. Using the Borland compiler, you should use the
  50. // PASCAL macro in the C/C++ header files as it will expand to
  51. // __pascal in 16-bit targets and __stdcall in 32-bit targets.
  52. //
  53. long Multiply16(int i, long l)
  54.    {
  55.    }
  56.  
  57. void MultiplyReal16(TDouble v1, TDouble v2, TLDouble* result)
  58.    {
  59.    result = inout;
  60.    }
  61.  
  62. int StrTableSize16()
  63.    {
  64.    }
  65.  
  66. bool StringLookup16(int index, char * bfr)
  67.    {
  68.    bfr = inout;
  69.    }
  70.  
  71. int EmpCount16()
  72.    {
  73.    }
  74.  
  75. bool GetRecord16(int index, EmpRecord* rec)
  76.    {
  77.    rec = inout;
  78.    }
  79.  
  80.  
  81.  
  82.